<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Home</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <link href="css/pe-icons.css" rel="stylesheet">
    <link href="css/prettyPhoto.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/mycss.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/normalize.css"/>
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" href="layui/css/layui.css" />

    <script src="js/jquery.js"></script>
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
    <link rel="shortcut icon" href="images/ico/favicon.ico">
    <link rel="apple-touch-icon" sizes="144x144" href="images/ico/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="114x114" href="images/ico/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="72x72" href="images/ico/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" href="images/ico/apple-touch-icon-57x57.png">

    <script type="text/javascript">

        jQuery(document).ready(function ($) {
            'use strict';
            jQuery('body').backstretch([
                "images/bg/bg1.jpg",
                "images/bg/bg2.jpg",
                "images/bg/bg3.jpg"
            ], {duration: 5000, fade: 500, centeredY: true});


        });
    </script>
</head><!--/head-->
<body>
<div id="preloader"></div>
<header class="navbar navbar-inverse navbar-fixed-top " role="banner" style="display: block">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <i class="fa fa-bars"></i>
            </button>
            <a class="navbar-brand" href="index.html"><h1><span class="pe-7s-gleam bounce-in"></span>阳光攀枝花</h1></a>
        </div>
        <div class="collapse navbar-collapse wrap">
            <ul class="nav navbar-nav navbar-right" id="nav">
                <li><a href="index.html">主页</a></li>
                <li><a href="information.html">热门资讯</a></li>
                <li>
                    <a href="hotSpots.html">热门景点</a>
                    <ul id="sceneryClassifications">

                    </ul>
                </li>
                <li>
                    <a href="specialFood.html">特色美食</a>
                    <ul id="foodClassifications">

                    </ul>
                </li>
                <li>
                    <a href="touristRoute.html">旅游路线</a>
                    <ul id="routeClassifications">

                    </ul>
                </li>
                <li>
                    <a href="hotelReservation.html">酒店预订</a>
                    <ul id="hotelClassifications">

                    </ul>
                </li>
                <li class="dropdown active">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">联系我们<i class="icon-angle-down"></i></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">微信公众号</a></li>
                        <li><a href="http://39.107.45.130:9003/index.html">后台管理员</a></li>
                    </ul>
                </li>
                <li><a href="contact-us.html">注册</a></li>
                <li><a href="toLogin.html" class="">登录</a></li>
                <!--<li><span class="search-trigger"><i class="fa fa-search"></i></span></li>-->
            </ul>
        </div>
    </div>
</header><!--/header-->

<div id="content-wrapper" class="loginDiv">
    <section id="main-slider" class="no-margin">
        <!-- 中间部分开始 -->
        <div class="loginInner">
            <div class="left">

            </div>
            <div class="loginJfrme fr">
                <div class="loginText">
                    用户登录
                </div>

                <form action="#" method="post">
<!--                    <span class="icon-user"></span>-->
                    <div class="inputText"><span class="icon-user loginSpan"/><input type="text" name="stuNO" class="inputTextInner loginTel" placeholder="请输入电话"/></div>
                    <div class="inputText"><span class="icon-lock loginSpan"/><input type="password" name="" class="inputTextInner loginPsw" placeholder="请输入密码"/></div>

                    <input type="button" class="loginSubmitBtn" value="立即登录"/><span class="loginText2">
            忘记密码？</span>
                </form>
            </div>
        </div>
    </section>
</div>

<!--<div th:replace="information :: Pagefoot"></div>-->
<input type="hidden" id="bindUserInfo" th:value="${userInfo}">
<div id="footer-wrapper">
    <footer id="footer" class="">
        <div class="container">
            <div class="row">
                <div class="col-sm-8">
                    ICP备案号：蜀ICP备05017906号<a target="_blank" href="http://sc.chinaz.com/moban/"> 攀枝花学院</a>
                </div>
                <div class="col-sm-4">
                    <ul class="pull-right">
                        <li><a id="gototop" class="gototop" href="#"><i class="fa fa-chevron-up"></i></a></li>
                        <!--#gototop-->
                    </ul>
                </div>
            </div>
        </div>
    </footer><!--/#footer-->
</div>

<script src="js/plugins.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/init.js"></script>
<script src="js/common.js"></script>
<script src="layui/layui.js"></script>

<script>
    var layer;
    // 页面加载函数
    $(function () {
        layui.use('layer', function(){
            layer = layui.layer;
        });

        $(".loginSubmitBtn").click(function () {

           //alert("sdf");
           var useId = $(".loginTel").val();
           var pws = $(".loginPsw").val();
           //进行表单的验证；
           var patt = /^\d{11}$/; //这是一个正则对象
           if (!patt.test(useId.toString())){
               layer.msg("您输入的电话有误，请重新输入！");
               // alert("dsfd");
               return;
           }
           patt = /([a-zA-Z0-9]|[._]){5,17}$/;

           if (!patt.test(pws.toString())) {
               layer.msg("您输入的密码格式有问题，请重新输入！");
               return;
           }
           // 进行异步登录
           $.ajax({
               "url":"user/do/login",
               "data":{
                   "userTel":useId,
                   "loginPwd":pws
               },
               "dataType":"json",
               "error":function (response) {
                   alert("服务器异常，请联系管理员！！");
                   return;
               },
               "success":function (response) {
                   var result = response.result;  //接收后台返回的数据；
                   if (result == "FAILED") {
                       // alert(response.data);
                       layer.msg(response.message);
                       return;
                   }else {
                       //进行后台页面的跳转；
                       window.open("http://39.107.45.130/user/admin/index.html");
                       // window.location.href = "www.baidu.com";//进行页面的跳转；
                   }
               }
           })
       })
    })
</script>



</body>
</html>
